﻿using Caliburn.Micro;

namespace YiJing.Model
{
    public sealed class Line : PropertyChangedBase
    {
        private bool _isBroken;
        private bool _isMoving;

        public bool IsBroken
        {
            get { return _isBroken; }
            set
            {
                if (value == IsBroken) return;

                _isBroken = value;
                NotifyOfPropertyChange(() => IsBroken);
            }
        }

        public bool IsMoving
        {
            get { return _isMoving; }
            set
            {
                if (value == IsMoving) return;

                _isMoving = value;
                NotifyOfPropertyChange(() => IsMoving);
            }
        }

        public Line Clone()
        {
            return new Line { IsBroken = IsBroken, IsMoving = IsMoving };
        }

        public Line Move()
        {
            return new Line { IsBroken = IsMoving ? ! IsBroken : IsBroken };
        }

        public Line Toggle()
        {
            return new Line { IsBroken = !IsBroken };
        }
    }
}